%Inverted Pendulum
%
%Fall 2008
%
%Taylor Johnson
%johnso99@nospam-illinois.edu
%University of Illinois at Urbana-Champaign
%Coordinated Science Laboratory
%Department of Electrical and Computer Engineering
%
%Main Module - Analysis and System Evolution
%

% static float a[4][4] = { {37.62, 58.22, 17.87, 11.61},
% 	{58.22, 313.16, 69.36, 56.09},
% 	{17.87, 69.36, 29.81, 14.81},
% 	{11.61, 56.09, 14.81, 12.04}
% 	};

% xa[0] = 1.0 * (x) + (-0.00051281) * (-theta) + 0.017961 * (xdot) +
% 		(-0.0000026781) * (-thetadot);
% 	xa[1] = 0 * (x) + 1.0056 * (-theta) + 0.0046419 * (xdot) +
% 		0.020029 * (-thetadot);
% 	xa[2] = 0 * (x) + (-0.049519) * (-theta) + 0.80322 * (xdot) +
% 		(-0.00043546) * (-thetadot);
% 	xa[3] = 0 * (x) + 0.55967 * (-theta) + 0.44824 * (xdot) +
% 		1.0048 * (-thetadot);
% 
% 	xa[0] += 0.0003618 * local_volts;
% 	xa[1] += (-0.00082708) * local_volts;
% 	xa[2] += 0.034913 * local_volts;
% 	xa[3] += (-0.079879) * local_volts;

clear all;

theta_min_deg=-30;  %degrees
theta_max_deg=30;   %degrees
theta_min_rad=deg2rad(theta_min_deg);   %radians
theta_max_rad=deg2rad(theta_max_deg);   %radians
%x_min=-0.7;         %meters
%x_max=0.7;          %meters
x_min=-0.2;         %meters
x_max=0.2;          %meters
xdot_min=-1;        %meters/second
xdot_max=1;         %meters/second
va_min=-4.95;       %volts
va_max=4.95;        %volts

Ts=0.020;
Tc=0.020;   %20ms control period
fs=1/Ts;
fc=1/Tc;

syms x1 x2 x3 x4;     %state variables
syms x01 x02 x03 x04; %initial conditions
syms a22 a23 a24 a42 a43 a44; %system matrix
syms a22w a23w a24w a42w a43w a44w; %system matrix
syms b2 b4; %control matrix
syms Va;

%physical parameters
g=-9.8; %gravity: -9.8 m/s
m=1;    %mass
Ki=0.9; %torque constant
Kb=0.9; %back-emf constant
Kg=1;   %gear ratio
r=2; %
Ra=0.95;    %armature resistance
Bm=1.95;    %
Btheta=0.95;    
Bbar=((Kg*Bm)/(r^2))+(((Kg^2)*Ki*Kb)/((r^2)*Ra));
Bl=((Kg*Ki)/(r*Ra));
M=5;    %mass
Jm=5;   %moment of inertia
l=0.5;  %length
Mbar=m+M+(Kg*Jm)/(r^2); %effective mass
Dl=(4*Mbar)-3*m;

X0s=[x01 x02 x03 x04]';
X=[x1 x2 x3 x4];
U=[Va];
%As=[0 1 0 0; 0 -a22 -a23 a24; 0 0 0 1; 0 a42 a43 -a44];
As=[0 0 1 0; ; 0 0 0 1; 0 -a22 -a23 a24; 0 a42 a43 -a44];
Asw=[0 1 0 0; 0 -a22w -a23w a24w; 0 0 0 1; 0 a42w a43w -a44w];
%Bs=[0; b2; 0; -b4];
Bs=[0; 0; b2; -b4];
%a22=0.1;  a23=0.01;    a24=0.01;  a42=0.01;  a43=0.5;  a44=0.1;
%a22w=(4*Bbar)/(Dl);  a23w=(3*m*g)/(Dl);   a24w=(6*Btheta)/(l*Dl);
%a42w=(6*Bbar)/(l*Dl);    a43w=(6*Mbar*g)/(l*Dl);  a44w=(12*Mbar*Btheta)/(m*(l^2)*Dl);
a22=2.75; a23=10.95; a24=0.0043; a42=28.58; a43=24.92; a44=0.044; %real matrix

%Xreal=[x theta xdot thetadot]'

%b2=0.1;   b4=0.5;
%b2=(4*Bl)/(Dl); b4=(6*Bl)/(l*Dl);
b2=1.94; b4=4.44; %real matrix
%x1=x, x2=x', x3=theta, x4=theta'
%x01=0.1; x02=0.2; x03=0.5; x04=-0.5;
%x01=0.05; x02=0.05; x03=0.05; x04=0.05; %interesting plot: edge of safety
%area
%x01=0.05; x02=0.05; x03=-0.05; x04=0.05;
%x01=0.1; x02=0.15; x03=0.05; x04=0.05;
%x01=0.05; x02=0.05; x03=-0.1; x04=-0.1; %edge of larger safety
%x01=-0.15; x02=-0.21; x03=0.4; x04=1.25;
%x01=-0.19; x02=-0.2418; x03=0.3; x04=1.41; %extrema safety
x01=-1; x02=-0.2581; x03=0.13; x04=1.17; %extrema experimental

A=eval(As);
Aw=eval(Asw);
B=eval(Bs);
X0=eval(X0s);

%A=[37.62, 58.22, 17.87, 11.61; 58.22, 313.16, 69.36, 56.09; 17.87, 69.36, 29.81, 14.81; 11.61, 56.09, 14.81, 12.04];
%A=[1 -0.00051281 0.017961 -0.0000026781; 0 1.0056 0.0046419 0.020029; 0 -0.049519 0.80322 -0.00043546; 0 0.55967 0.44824 1.0048;]

%B=[0.0003618; -0.00082708; 0.034913; -0.079879];

Q=eye(4); %positive definite Q
syms p11 p12 p13 p14 p22 p23 p24 p33 p34 p44;
P=[p11 p12 p13 p14; p12 p22 p23 p24; p13 p23 p33 p34; p14 p24 p34 p44];

%linear state feedback control: V_a=KX=inv(-R)B'SX
%A'S+SA-SBinv(R)B'S+D=0
%R1=0.01
%R2=0.01
%D=eye(4)

syms KS1 KS2 KS3 KS4 KB1 KB2 KB3 KB4 KE1 KE2 KE3 KE4;
%KS=[7.6,  13.54, 42.85,  8.25];     %safety
%KS=[6.0, 20.0, 60.0, 16.0];         %safety (real system)
KS=[7.6,  42.85, 13.54,  8.25];     %safety
KSs=[KS1, KS2, KS3, KS4];           %safety symbolic
%KB=[3.16, 19.85, 69.92,  14.38];    %baseline
%KB=[8.0, 32.0, 120.0, 12.0];        %baseline (real system)
KB=[3.16, 69.92, 19.85,  14.38];    %baseline
KBs=[KB1, KB2, KB3, KB4];
%KE=[10.0, 27.72, 103.36, 23.04];    %experimental
%KE=[5.7807, 42.2087, 14.0953, 8.6016];
KE=[10.0, 103.36, 27.72, 23.04];    %experimental
%KE=[10.0, 36.0, 140.0, 14.0];       %experimental (real system)
KEs=[KE1, KE2, KE3, KE4];

%from lmi
Plmi=[38.3367   26.2506    8.6703    4.7515; 26.2506   56.5561   15.2589    8.6971; 8.6703   15.2589    6.6481    3.2088; 4.7515    8.6971    3.2088    1.8244];
%Klmi=[7.2671   30.1022   11.7542    5.9111];
%KS=Klmi;
det(Plmi); %must be greater than 0 (shows P is positive definite)

%Xdot=Abar*X
AbarS=A+B*KS;
AbarSs=As+Bs*KSs;
AbarB=A+B*KB;
AbarE=A+B*KE;

det(AbarS'*Plmi+Plmi*AbarS); %must be less than 0 (shows positive negative, and shows lyapunov derivative is negative always)
det(AbarB'*Plmi+Plmi*AbarB); %must be less than 0 (shows positive negative, and shows lyapunov derivative is negative always)
det(AbarE'*Plmi+Plmi*AbarE); %must be less than 0 (shows positive negative, and shows lyapunov derivative is negative always)

C=[0 1 0 1];
sysS=ss(A,B*KS,C,0);
sysB=ss(A,B*KB,C,0);
sysE=ss(A,B*KE,C,0);
%figure;
%nyquist(sysS);
%hold on;
%nyquist(sysB);
%nyquist(sysE);
%legend('Safety', 'Baseline', 'Experimental');

sysdS=ss(A,B*KS,C,0,Tc);
sysdB=ss(A,B*KB,C,0,Tc);
sysdE=ss(A,B*KE,C,0,Tc);
%figure;
%nyquist(sysdS);
%hold on;
%nyquist(sysdB);
%nyquist(sysdE);
%legend('Safety', 'Baseline', 'Experimental');

%syms t;
%Abarexpm=expm(AbarS*t);

eigAbarS=eig(AbarS)
eigAbarB=eig(AbarB)
eigAbarE=eig(AbarE)

%Lyapunov and Discrete Lyapunov Equations for each System
P3=lyap(AbarS',Q)
PD3=dlyap(AbarS',Q)
P2=lyap(AbarB',Q)
PD2=dlyap(AbarB',Q)
P1=lyap(AbarE',Q)
PD1=dlyap(AbarE',Q)

SPtBad=0;
SPdtBad=0;

%set up for previous state (for switching)
Sxtmp=X0;
Sutmp=0;

Bxtmp=X0;
Butmp=0;

Extmp=X0;
Eutmp=0;

SwRxtmp=X0;
SwRutmp=0;

fSwRxtmp=X0;
fSwRutmp=0;

%Timing is crucial to our simulation here.  We use the given control cycle
%time of Tc=20ms to control the main operation (that is, the control is 
%updated every 20ms), then tdiv is the number of
%subsamples to also model within this main period, so that we have smoother
%trajectories within this larger control cycle.
tcyc=Tc;
tdiv=30; %minimum is 1 (1 division per control cycle, same as only looking at control cycle)
tmax=5;
time_ctrl=[0:tcyc:tmax]';      %vector of control cycle times
time_traj=[0:tcyc/tdiv:tmax]'; %vector of trajectories

%these are constants
F=expm(A*Tc);
Ft=expm(A*(tcyc/tdiv));
PF=lyap(F,-Q);
%F=A*Tc;
syms tau;
%G=int(expm(A*tau),tau,0,Tc);
%G=A*(expm(A*Tc)-eye(4)); %int(expm(A*tau),tau,0,Tc)=A*expm(A*tau)|0,Tc=A*(expm(A*T)-expm(A*0))=A*(expm(A*T)-I)
%[v,d]=eig(A);
%G=eval(int((v*diag(exp(diag(d)))/v)*tau,0,Tc));
G=pinv(A)*(expm(A*Tc)-eye(4));
Gt=pinv(A)*(expm(A*(tcyc/tdiv))-eye(4));
%G=inv(A)*((A*Tc)-eye(4));
%from mathematica:
%G=[0.02, 0.000199867, -1.32935*10^-8, 1.32535*10^-8; 4.38118*10^-19,
%0.01998, -1.99204*10^-6, 1.98405*10^-6;7.78952*10^-21, 1.33201*10^-8,
%0.0200007, 0.00019987; 1.47391*10^-20, 1.99737*10^-6, 0.0000999349, 0.0199807];

Sxtmpi=Sxtmp;

cS=norm(P3*B,inf)/(min(eig(Q)));
dS=norm(KS*A,inf)+norm(KS*B*KS,inf);
tauS=1/(cS*dS);

cB=norm(P2*B,inf)/(min(eig(Q)));
dB=norm(KB*A,inf)+norm(KB*B*KB,inf);
tauB=1/(cB*dB);

cE=norm(P1*B,inf)/(min(eig(Q)));
dE=norm(KE*A,inf)+norm(KE*B*KE,inf);
tauE=1/(cE*dE);

Sxtmpp=[0 0 0 0]'; %starting
Sxtmppp=[0 0 0 0]';

St(1:4,1)=X0;
Bt(1:4,1)=X0;
Et(1:4,1)=X0;
Swt(1:4,1)=X0;

for t=0:tcyc:tmax-tcyc
    i=round(t/tcyc)+1;

    Sxtmpppp=Sxtmppp;
    Sxtmppp=Sxtmpp;
    Sxtmpp=Sxtmp;
%    if (i>1)
%        SxtmppAprx=[Sxtmpp(1) Sxtmpp(2) ((Sxtmpp(1)-Sxtmpppp(1))/(2*Ts)) ((Sxtmpp(2)-Sxtmpppp(2))/(2*Ts))]';
%    else
%        SxtmppAprx=Sxtmp; %just assume perfect for starting case (otherwise could use other, but it will cause a step input to system)
%    end;
    SxtmppAprx=Sxtmpp;
    
    if (i>1)
        Sutmp=KS*Sxtmpp;
        SuSattmp=checkExtrema(Sutmp, va_min, va_max);
        Sxtmp=F*Sxtmpp + G*B*SuSattmp;
    else
        SuSattmp=0;
        Sxtmp=X0;
    end;
    Sxtmpi=Sxtmp;

    Bxtmpp=Bxtmp;
    if (i>1)
        Butmp=KB*Bxtmpp;
        BuSattmp=checkExtrema(Butmp, va_min, va_max); %u=kx: maybe some problem here since we're doing u=k*expm(A+Bk)*x0?
        Bxtmp=F*Bxtmpp + G*B*BuSattmp;
    else
        BuSattmp=0;
        Bxtmp=X0;
    end;
    Bxtmpi=Bxtmp;

    Extmpp=Extmp;
    if (i>1)
        Eutmp=KE*Extmpp;
        EuSattmp=checkExtrema(Eutmp, va_min, va_max); %u=kx: maybe some problem here since we're doing u=k*expm(A+Bk)*x0?
        Extmp=F*Extmpp + G*B*EuSattmp; %need to use previous for I.C. (don't update for inside divisions!)
    else
        EuSattmp=0;
        Extmp=X0;
    end;
    Extmpi=Extmp;
    
    SwRxtmpp=SwRxtmp;
    %Switch between Safety -> Baseline -> Experimental -> Safety properly
    if (i>1)
        if (mod(i-1,3)==1)
            SwRuSattmp=KS*SwRxtmpp;
            SwRutmp=checkExtrema(SwRuSattmp, va_min, va_max);
            SwRxtmp=F*SwRxtmpp + G*B*SwRuSattmp;
        elseif (mod(i-1,3)==2)
            SwRuSattmp=KB*SwRxtmpp;
            SwRutmp=checkExtrema(SwRuSattmp, va_min, va_max);
            SwRxtmp=F*SwRxtmpp + G*B*SwRuSattmp;
        else
            SwRuSattmp=KE*SwRxtmpp;
            SwRutmp=checkExtrema(SwRuSattmp, va_min, va_max);
            SwRxtmp=F*SwRxtmpp + G*B*SwRuSattmp;
        end;
    else
        SwRuSattmp=0;
        SwRxtmp=X0;
    end;
    SwRxtmpi=SwRxtmp;
    
    for j=(i-1)*tdiv+2 : 1 : tdiv+(i-1)*tdiv+1
        tt=j*(tcyc/tdiv);

        Sxtmpi=Ft*Sxtmpi+Gt*B*SuSattmp;
        St(1:4,j)=Sxtmpi;
        Sut(j)=Sutmp;     %u
        SuSatt(j)=SuSattmp;
        SPt(j)=Sxtmpi.'*P3*Sxtmpi; %V=x'Px
        SPdt(j)=(Sxtmpi.'*AbarS.'*P3*Sxtmpi) + (Sxtmpi.'*P3*AbarS*Sxtmpi); %Vdot=x'A'Px+x'PAx
        SDPt(j)=Sxtmpi.'*PD3*Sxtmpi; %Vd=x'Px
        SDPdt(j)=(Sxtmpi.'*AbarS.'*PD3*Sxtmpi) + (Sxtmpi.'*PD3*AbarS*Sxtmpi); %Vdot=x'A'Px+x'PAx
        
        Bxtmpi=Ft*Bxtmpi+Gt*B*BuSattmp;
        Bt(1:4,j)=Bxtmpi;
        But(j)=Butmp;     %u
        BuSatt(j)=BuSattmp;
        BPt(j)=Bxtmpi.'*P2*Bxtmpi; %V=x'Px
        BPdt(j)=(Bxtmpi.'*AbarB.'*P2*Bxtmpi) + (Bxtmpi.'*P2*AbarB*Bxtmpi); %Vdot=x'A'Px+x'PAx
        BDPt(j)=Bxtmpi.'*PD2*Bxtmpi; %Vd=x'Px
        BDPdt(j)=(Bxtmpi.'*AbarB.'*PD2*Bxtmpi) + (Bxtmpi.'*PD2*AbarB*Bxtmpi); %Vdot=x'A'Px+x'PAx

        Extmpi=Ft*Extmpi+Gt*B*EuSattmp;
        Et(1:4,j)=Extmpi;
        Eut(j)=Eutmp;     %u
        EuSatt(j)=EuSattmp;
        EPt(j)=Extmpi.'*P1*Extmpi; %V=x'Px
        EPdt(j)=(Extmpi.'*AbarE.'*P1*Extmpi) + (Extmpi.'*P1*AbarE*Extmpi); %Vdot=x'A'Px+x'PAx
        EDPt(j)=Extmpi.'*PD1*Extmpi; %Vd=x'Px
        EDPdt(j)=(Extmpi.'*AbarE.'*PD1*Extmpi) + (Extmpi.'*PD1*AbarE*Extmpi); %Vdot=x'A'Px+x'PAx

        SwRxtmpi=Ft*SwRxtmpi+Gt*B*SwRuSattmp;
        if (mod(i-1,3)==1)
            SwRPt(j) =SwRxtmpi.'*P3*SwRxtmpi; %V=x'Px
            SwRPdt(j)=(SwRxtmpi.'*AbarS.'*P3*SwRxtmpi) + (SwRxtmpi.'*P3*AbarS*SwRxtmpi); %Vdot=x'A'Px+x'PAx
        elseif (mod(i-1,3)==2)
            SwRPt(j) =SwRxtmpi.'*P2*SwRxtmpi; %V=x'Px
            SwRPdt(j)=(SwRxtmpi.'*AbarB.'*P2*SwRxtmpi) + (SwRxtmpi.'*P2*AbarB*SwRxtmpi); %Vdot=x'A'Px+x'PAx
        else
            SwRPt(j) =SwRxtmpi.'*P1*SwRxtmpi; %V=x'Px
            SwRPdt(j)=(SwRxtmpi.'*AbarE.'*P1*SwRxtmpi) + (SwRxtmpi.'*P1*AbarE*SwRxtmpi); %Vdot=x'A'Px+x'PAx
        end;
        Swt(1:4,j)=SwRxtmpi;
        SwRut(j)=SwRutmp;    %u
        SwRuSatt(j)=SwRuSattmp;
    end;
end;

%stabilizable region
%[SPlmi,Sxbound1,Sxbound2]=generateStabilizableRegion(A, B, KS, 0, 0);
%[BPlmi,Bxbound1,Bxbound2]=generateStabilizableRegion(A, B, KB, 0, 0);
%[EPlmi,Exbound1,Exbound2]=generateStabilizableRegion(A, B, KE, 0, 0);

%computed
Sxb1=[-0.195000000000000,-0.195000000000000,-0.190000000000000,-0.190000000000000,-0.185000000000000,-0.185000000000000,-0.180000000000000,-0.180000000000000,-0.175000000000000,-0.175000000000000,-0.170000000000000,-0.170000000000000,-0.165000000000000,-0.165000000000000,-0.160000000000000,-0.160000000000000,-0.155000000000000,-0.155000000000000,-0.150000000000000,-0.150000000000000,-0.145000000000000,-0.145000000000000,-0.140000000000000,-0.140000000000000,-0.135000000000000,-0.135000000000000,-0.130000000000000,-0.130000000000000,-0.125000000000000,-0.125000000000000,-0.120000000000000,-0.120000000000000,-0.115000000000000,-0.115000000000000,-0.110000000000000,-0.110000000000000,-0.105000000000000,-0.105000000000000,-0.100000000000000,-0.100000000000000,-0.0950000000000000,-0.0950000000000000,-0.0900000000000000,-0.0900000000000000,-0.0850000000000000,-0.0850000000000000,-0.0800000000000000,-0.0800000000000000,-0.0750000000000000,-0.0750000000000000,-0.0700000000000000,-0.0700000000000000,-0.0650000000000000,-0.0650000000000000,-0.0600000000000000,-0.0600000000000000,-0.0550000000000000,-0.0550000000000000,-0.0500000000000000,-0.0500000000000000,-0.0450000000000000,-0.0450000000000000,-0.0400000000000000,-0.0400000000000000,-0.0350000000000000,-0.0350000000000000,-0.0300000000000000,-0.0300000000000000,-0.0250000000000000,-0.0250000000000000,-0.0200000000000000,-0.0200000000000000,-0.0150000000000000,-0.0150000000000000,-0.0100000000000000,-0.0100000000000000,-0.00500000000000000,-0.00500000000000000,0,0,0.00500000000000000,0.00500000000000000,0.00999999999999998,0.00999999999999998,0.0150000000000000,0.0150000000000000,0.0200000000000000,0.0200000000000000,0.0250000000000000,0.0250000000000000,0.0300000000000000,0.0300000000000000,0.0350000000000000,0.0350000000000000,0.0400000000000000,0.0400000000000000,0.0450000000000000,0.0450000000000000,0.0500000000000000,0.0500000000000000,0.0550000000000000,0.0550000000000000,0.0600000000000000,0.0600000000000000,0.0650000000000000,0.0650000000000000,0.0700000000000000,0.0700000000000000,0.0750000000000000,0.0750000000000000,0.0800000000000000,0.0800000000000000,0.0850000000000000,0.0850000000000000,0.0900000000000000,0.0900000000000000,0.0950000000000000,0.0950000000000000,0.100000000000000,0.100000000000000,0.105000000000000,0.105000000000000,0.110000000000000,0.110000000000000,0.115000000000000,0.115000000000000,0.120000000000000,0.120000000000000,0.125000000000000,0.125000000000000,0.130000000000000,0.130000000000000,0.135000000000000,0.135000000000000,0.140000000000000,0.140000000000000,0.145000000000000,0.145000000000000,0.150000000000000,0.150000000000000,0.155000000000000,0.155000000000000,0.160000000000000,0.160000000000000,0.165000000000000,0.165000000000000,0.170000000000000,0.170000000000000,0.175000000000000,0.175000000000000,0.180000000000000,0.180000000000000,0.185000000000000,0.185000000000000,0.190000000000000,0.190000000000000,0.195000000000000,0.195000000000000;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;0.110000000000000,0.250000000000000,0.0800000000000001,0.270000000000000,0.0500000000000000,0.290000000000000,0.0300000000000000,0.300000000000000,0.0100000000000000,0.310000000000000,-0.0100000000000000,0.320000000000000,-0.0200000000000000,0.330000000000000,-0.0400000000000000,0.340000000000000,-0.0499999999999999,0.340000000000000,-0.0700000000000000,0.350000000000000,-0.0800000000000000,0.350000000000000,-0.0900000000000000,0.360000000000000,-0.110000000000000,0.360000000000000,-0.120000000000000,0.360000000000000,-0.130000000000000,0.360000000000000,-0.140000000000000,0.370000000000000,-0.150000000000000,0.370000000000000,-0.160000000000000,0.370000000000000,-0.170000000000000,0.370000000000000,-0.180000000000000,0.370000000000000,-0.190000000000000,0.370000000000000,-0.200000000000000,0.370000000000000,-0.200000000000000,0.370000000000000,-0.210000000000000,0.370000000000000,-0.220000000000000,0.370000000000000,-0.230000000000000,0.360000000000000,-0.240000000000000,0.360000000000000,-0.240000000000000,0.360000000000000,-0.250000000000000,0.360000000000000,-0.260000000000000,0.360000000000000,-0.260000000000000,0.350000000000000,-0.270000000000000,0.350000000000000,-0.270000000000000,0.350000000000000,-0.280000000000000,0.340000000000000,-0.290000000000000,0.340000000000000,-0.290000000000000,0.340000000000000,-0.300000000000000,0.330000000000000,-0.300000000000000,0.330000000000000,-0.310000000000000,0.330000000000000,-0.310000000000000,0.320000000000000,-0.320000000000000,0.320000000000000,-0.320000000000000,0.310000000000000,-0.320000000000000,0.310000000000000,-0.330000000000000,0.300000000000000,-0.330000000000000,0.300000000000000,-0.330000000000000,0.290000000000000,-0.340000000000000,0.280000000000000,-0.340000000000000,0.280000000000000,-0.340000000000000,0.270000000000000,-0.350000000000000,0.270000000000000,-0.350000000000000,0.260000000000000,-0.350000000000000,0.250000000000000,-0.350000000000000,0.250000000000000,-0.350000000000000,0.240000000000000,-0.360000000000000,0.230000000000000,-0.360000000000000,0.220000000000000,-0.360000000000000,0.210000000000000,-0.360000000000000,0.210000000000000,-0.360000000000000,0.200000000000000,-0.360000000000000,0.190000000000000,-0.360000000000000,0.180000000000000,-0.360000000000000,0.170000000000000,-0.360000000000000,0.160000000000000,-0.360000000000000,0.150000000000000,-0.350000000000000,0.140000000000000,-0.350000000000000,0.130000000000000,-0.350000000000000,0.120000000000000,-0.350000000000000,0.100000000000000,-0.340000000000000,0.0900000000000001,-0.340000000000000,0.0800000000000001,-0.330000000000000,0.0600000000000001,-0.330000000000000,0.0500000000000000,-0.320000000000000,0.0300000000000000,-0.310000000000000,0.0200000000000000,-0.300000000000000,0,-0.290000000000000,-0.0200000000000000,-0.280000000000000,-0.0400000000000000,-0.260000000000000,-0.0700000000000000,-0.240000000000000,-0.100000000000000;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;];
Sxb2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;-0.256799387799149,-0.256799387799149,-0.251799387799149,-0.251799387799149,-0.246799387799149,-0.246799387799149,-0.241799387799149,-0.241799387799149,-0.236799387799149,-0.236799387799149,-0.231799387799149,-0.231799387799149,-0.226799387799149,-0.226799387799149,-0.221799387799149,-0.221799387799149,-0.216799387799149,-0.216799387799149,-0.211799387799149,-0.211799387799149,-0.206799387799149,-0.206799387799149,-0.201799387799149,-0.201799387799149,-0.196799387799149,-0.196799387799149,-0.191799387799149,-0.191799387799149,-0.186799387799149,-0.186799387799149,-0.181799387799149,-0.181799387799149,-0.176799387799149,-0.176799387799149,-0.171799387799149,-0.171799387799149,-0.166799387799149,-0.166799387799149,-0.161799387799149,-0.161799387799149,-0.156799387799149,-0.156799387799149,-0.151799387799149,-0.151799387799149,-0.146799387799149,-0.146799387799149,-0.141799387799149,-0.141799387799149,-0.136799387799149,-0.136799387799149,-0.131799387799149,-0.131799387799149,-0.126799387799149,-0.126799387799149,-0.121799387799149,-0.121799387799149,-0.116799387799149,-0.116799387799149,-0.111799387799149,-0.111799387799149,-0.106799387799149,-0.106799387799149,-0.101799387799149,-0.101799387799149,-0.0967993877991494,-0.0967993877991494,-0.0917993877991494,-0.0917993877991494,-0.0867993877991494,-0.0867993877991494,-0.0817993877991494,-0.0817993877991494,-0.0767993877991494,-0.0767993877991494,-0.0717993877991494,-0.0717993877991494,-0.0667993877991494,-0.0667993877991494,-0.0617993877991494,-0.0617993877991494,-0.0567993877991494,-0.0567993877991494,-0.0517993877991494,-0.0517993877991494,-0.0467993877991494,-0.0467993877991494,-0.0417993877991494,-0.0417993877991494,-0.0367993877991494,-0.0367993877991494,-0.0317993877991494,-0.0317993877991494,-0.0267993877991494,-0.0267993877991494,-0.0217993877991494,-0.0217993877991494,-0.0167993877991494,-0.0167993877991494,-0.0117993877991494,-0.0117993877991494,-0.00679938779914940,-0.00679938779914940,-0.00179938779914940,-0.00179938779914940,0.00320061220085061,0.00320061220085061,0.00820061220085061,0.00820061220085061,0.0132006122008506,0.0132006122008506,0.0182006122008506,0.0182006122008506,0.0232006122008506,0.0232006122008506,0.0282006122008506,0.0282006122008506,0.0332006122008506,0.0332006122008506,0.0382006122008506,0.0382006122008506,0.0432006122008506,0.0432006122008506,0.0482006122008506,0.0482006122008506,0.0532006122008506,0.0532006122008506,0.0582006122008506,0.0582006122008506,0.0632006122008506,0.0632006122008506,0.0682006122008506,0.0682006122008506,0.0732006122008506,0.0732006122008506,0.0782006122008506,0.0782006122008506,0.0832006122008506,0.0832006122008506,0.0882006122008506,0.0882006122008506,0.0932006122008506,0.0932006122008506,0.0982006122008506,0.0982006122008506,0.103200612200851,0.103200612200851,0.108200612200851,0.108200612200851,0.113200612200851,0.113200612200851,0.118200612200851,0.118200612200851,0.123200612200851,0.123200612200851,0.128200612200851,0.128200612200851,0.133200612200851,0.133200612200851,0.138200612200851,0.138200612200851,0.143200612200851,0.143200612200851,0.148200612200851,0.148200612200851,0.153200612200851,0.153200612200851,0.158200612200851,0.158200612200851,0.163200612200851,0.163200612200851,0.168200612200851,0.168200612200851,0.173200612200851,0.173200612200851,0.178200612200851,0.178200612200851,0.183200612200851,0.183200612200851,0.188200612200851,0.188200612200851,0.193200612200851,0.193200612200851,0.198200612200851,0.198200612200851,0.203200612200851,0.203200612200851,0.208200612200851,0.208200612200851,0.213200612200851,0.213200612200851,0.218200612200851,0.218200612200851,0.223200612200851,0.223200612200851,0.228200612200851,0.228200612200851,0.233200612200851,0.233200612200851,0.238200612200851,0.238200612200851,0.243200612200851,0.243200612200851,0.248200612200851,0.248200612200851,0.253200612200851,0.253200612200851,0.258200612200851,0.258200612200851;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;1.22000000000000,1.43000000000000,1.14000000000000,1.45000000000000,1.08000000000000,1.46000000000000,1.02000000000000,1.46000000000000,0.970000000000000,1.46000000000000,0.930000000000000,1.46000000000000,0.880000000000000,1.45000000000000,0.830000000000000,1.45000000000000,0.790000000000000,1.44000000000000,0.750000000000000,1.43000000000000,0.710000000000000,1.42000000000000,0.670000000000000,1.41000000000000,0.630000000000000,1.39000000000000,0.590000000000000,1.38000000000000,0.560000000000000,1.37000000000000,0.520000000000000,1.35000000000000,0.480000000000000,1.34000000000000,0.450000000000000,1.32000000000000,0.410000000000000,1.31000000000000,0.380000000000000,1.29000000000000,0.340000000000000,1.27000000000000,0.310000000000000,1.25000000000000,0.280000000000000,1.24000000000000,0.240000000000000,1.22000000000000,0.210000000000000,1.20000000000000,0.180000000000000,1.18000000000000,0.150000000000000,1.16000000000000,0.120000000000000,1.14000000000000,0.0800000000000001,1.12000000000000,0.0500000000000003,1.10000000000000,0.0200000000000000,1.08000000000000,-0.00999999999999979,1.06000000000000,-0.0400000000000000,1.04000000000000,-0.0699999999999998,1.02000000000000,-0.100000000000000,1,-0.130000000000000,0.980000000000000,-0.160000000000000,0.950000000000000,-0.190000000000000,0.930000000000000,-0.210000000000000,0.910000000000000,-0.240000000000000,0.890000000000000,-0.270000000000000,0.860000000000000,-0.300000000000000,0.840000000000000,-0.330000000000000,0.820000000000000,-0.350000000000000,0.790000000000000,-0.380000000000000,0.770000000000000,-0.410000000000000,0.740000000000000,-0.430000000000000,0.720000000000000,-0.460000000000000,0.690000000000000,-0.490000000000000,0.670000000000000,-0.510000000000000,0.650000000000000,-0.540000000000000,0.620000000000000,-0.570000000000000,0.590000000000000,-0.590000000000000,0.570000000000000,-0.620000000000000,0.540000000000000,-0.640000000000000,0.520000000000000,-0.670000000000000,0.490000000000000,-0.690000000000000,0.460000000000000,-0.720000000000000,0.440000000000000,-0.740000000000000,0.410000000000000,-0.760000000000000,0.380000000000000,-0.790000000000000,0.360000000000000,-0.810000000000000,0.330000000000000,-0.840000000000000,0.300000000000000,-0.860000000000000,0.270000000000000,-0.880000000000000,0.240000000000000,-0.900000000000000,0.220000000000000,-0.930000000000000,0.190000000000000,-0.950000000000000,0.160000000000000,-0.970000000000000,0.130000000000000,-0.990000000000000,0.100000000000000,-1.01000000000000,0.0699999999999998,-1.04000000000000,0.0400000000000000,-1.06000000000000,0.0100000000000002,-1.08000000000000,-0.0200000000000000,-1.10000000000000,-0.0499999999999998,-1.12000000000000,-0.0800000000000001,-1.14000000000000,-0.110000000000000,-1.16000000000000,-0.150000000000000,-1.18000000000000,-0.180000000000000,-1.20000000000000,-0.210000000000000,-1.21000000000000,-0.240000000000000,-1.23000000000000,-0.280000000000000,-1.25000000000000,-0.310000000000000,-1.27000000000000,-0.340000000000000,-1.28000000000000,-0.380000000000000,-1.30000000000000,-0.410000000000000,-1.32000000000000,-0.450000000000000,-1.33000000000000,-0.480000000000000,-1.35000000000000,-0.520000000000000,-1.36000000000000,-0.560000000000000,-1.38000000000000,-0.590000000000000,-1.39000000000000,-0.630000000000000,-1.40000000000000,-0.670000000000000,-1.41000000000000,-0.710000000000000,-1.42000000000000,-0.750000000000000,-1.43000000000000,-0.790000000000000,-1.44000000000000,-0.840000000000000,-1.45000000000000,-0.880000000000000,-1.45000000000000,-0.930000000000000,-1.45000000000000,-0.980000000000000,-1.45000000000000,-1.03000000000000,-1.45000000000000,-1.09000000000000,-1.43000000000000,-1.15000000000000,-1.40000000000000,-1.23000000000000;];
Bxb1=[-0.180000000000000,-0.180000000000000,-0.175000000000000,-0.175000000000000,-0.170000000000000,-0.170000000000000,-0.165000000000000,-0.165000000000000,-0.160000000000000,-0.160000000000000,-0.155000000000000,-0.155000000000000,-0.150000000000000,-0.150000000000000,-0.145000000000000,-0.145000000000000,-0.140000000000000,-0.140000000000000,-0.135000000000000,-0.135000000000000,-0.130000000000000,-0.130000000000000,-0.125000000000000,-0.125000000000000,-0.120000000000000,-0.120000000000000,-0.115000000000000,-0.115000000000000,-0.110000000000000,-0.110000000000000,-0.105000000000000,-0.105000000000000,-0.100000000000000,-0.100000000000000,-0.0950000000000000,-0.0950000000000000,-0.0900000000000000,-0.0900000000000000,-0.0850000000000000,-0.0850000000000000,-0.0800000000000000,-0.0800000000000000,-0.0750000000000000,-0.0750000000000000,-0.0700000000000000,-0.0700000000000000,-0.0650000000000000,-0.0650000000000000,-0.0600000000000000,-0.0600000000000000,-0.0550000000000000,-0.0550000000000000,-0.0500000000000000,-0.0500000000000000,-0.0450000000000000,-0.0450000000000000,-0.0400000000000000,-0.0400000000000000,-0.0350000000000000,-0.0350000000000000,-0.0300000000000000,-0.0300000000000000,-0.0250000000000000,-0.0250000000000000,-0.0200000000000000,-0.0200000000000000,-0.0150000000000000,-0.0150000000000000,-0.0100000000000000,-0.0100000000000000,-0.00500000000000000,-0.00500000000000000,0,0,0.00500000000000000,0.00500000000000000,0.00999999999999998,0.00999999999999998,0.0150000000000000,0.0150000000000000,0.0200000000000000,0.0200000000000000,0.0250000000000000,0.0250000000000000,0.0300000000000000,0.0300000000000000,0.0350000000000000,0.0350000000000000,0.0400000000000000,0.0400000000000000,0.0450000000000000,0.0450000000000000,0.0500000000000000,0.0500000000000000,0.0550000000000000,0.0550000000000000,0.0600000000000000,0.0600000000000000,0.0650000000000000,0.0650000000000000,0.0700000000000000,0.0700000000000000,0.0750000000000000,0.0750000000000000,0.0800000000000000,0.0800000000000000,0.0850000000000000,0.0850000000000000,0.0900000000000000,0.0900000000000000,0.0950000000000000,0.0950000000000000,0.100000000000000,0.100000000000000,0.105000000000000,0.105000000000000,0.110000000000000,0.110000000000000,0.115000000000000,0.115000000000000,0.120000000000000,0.120000000000000,0.125000000000000,0.125000000000000,0.130000000000000,0.130000000000000,0.135000000000000,0.135000000000000,0.140000000000000,0.140000000000000,0.145000000000000,0.145000000000000,0.150000000000000,0.150000000000000,0.155000000000000,0.155000000000000,0.160000000000000,0.160000000000000,0.165000000000000,0.165000000000000,0.170000000000000,0.170000000000000,0.175000000000000,0.175000000000000,0.180000000000000,0.180000000000000;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;0.0500000000000000,0.150000000000000,0.0300000000000000,0.160000000000000,0.0100000000000000,0.180000000000000,0,0.190000000000000,-0.0200000000000000,0.190000000000000,-0.0300000000000000,0.200000000000000,-0.0400000000000000,0.210000000000000,-0.0499999999999999,0.210000000000000,-0.0599999999999999,0.210000000000000,-0.0700000000000000,0.220000000000000,-0.0700000000000000,0.220000000000000,-0.0800000000000000,0.220000000000000,-0.0900000000000000,0.230000000000000,-0.100000000000000,0.230000000000000,-0.100000000000000,0.230000000000000,-0.110000000000000,0.230000000000000,-0.120000000000000,0.230000000000000,-0.120000000000000,0.230000000000000,-0.130000000000000,0.230000000000000,-0.140000000000000,0.230000000000000,-0.140000000000000,0.230000000000000,-0.150000000000000,0.230000000000000,-0.150000000000000,0.230000000000000,-0.160000000000000,0.230000000000000,-0.160000000000000,0.230000000000000,-0.160000000000000,0.230000000000000,-0.170000000000000,0.230000000000000,-0.170000000000000,0.230000000000000,-0.180000000000000,0.230000000000000,-0.180000000000000,0.230000000000000,-0.180000000000000,0.230000000000000,-0.190000000000000,0.220000000000000,-0.190000000000000,0.220000000000000,-0.190000000000000,0.220000000000000,-0.200000000000000,0.220000000000000,-0.200000000000000,0.220000000000000,-0.200000000000000,0.210000000000000,-0.210000000000000,0.210000000000000,-0.210000000000000,0.210000000000000,-0.210000000000000,0.200000000000000,-0.210000000000000,0.200000000000000,-0.210000000000000,0.200000000000000,-0.220000000000000,0.190000000000000,-0.220000000000000,0.190000000000000,-0.220000000000000,0.190000000000000,-0.220000000000000,0.180000000000000,-0.220000000000000,0.180000000000000,-0.220000000000000,0.170000000000000,-0.220000000000000,0.170000000000000,-0.220000000000000,0.170000000000000,-0.220000000000000,0.160000000000000,-0.220000000000000,0.160000000000000,-0.220000000000000,0.150000000000000,-0.220000000000000,0.150000000000000,-0.220000000000000,0.140000000000000,-0.220000000000000,0.130000000000000,-0.220000000000000,0.130000000000000,-0.220000000000000,0.120000000000000,-0.220000000000000,0.110000000000000,-0.220000000000000,0.110000000000000,-0.220000000000000,0.100000000000000,-0.210000000000000,0.0900000000000001,-0.210000000000000,0.0800000000000001,-0.210000000000000,0.0800000000000001,-0.200000000000000,0.0700000000000001,-0.200000000000000,0.0600000000000001,-0.200000000000000,0.0500000000000000,-0.190000000000000,0.0400000000000000,-0.180000000000000,0.0300000000000000,-0.180000000000000,0.0100000000000000,-0.170000000000000,0,-0.150000000000000,-0.0200000000000000,-0.140000000000000,-0.0400000000000000;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;];
Bxb2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;-0.256799387799149,-0.256799387799149,-0.251799387799149,-0.251799387799149,-0.246799387799149,-0.246799387799149,-0.241799387799149,-0.241799387799149,-0.236799387799149,-0.236799387799149,-0.231799387799149,-0.231799387799149,-0.226799387799149,-0.226799387799149,-0.221799387799149,-0.221799387799149,-0.216799387799149,-0.216799387799149,-0.211799387799149,-0.211799387799149,-0.206799387799149,-0.206799387799149,-0.201799387799149,-0.201799387799149,-0.196799387799149,-0.196799387799149,-0.191799387799149,-0.191799387799149,-0.186799387799149,-0.186799387799149,-0.181799387799149,-0.181799387799149,-0.176799387799149,-0.176799387799149,-0.171799387799149,-0.171799387799149,-0.166799387799149,-0.166799387799149,-0.161799387799149,-0.161799387799149,-0.156799387799149,-0.156799387799149,-0.151799387799149,-0.151799387799149,-0.146799387799149,-0.146799387799149,-0.141799387799149,-0.141799387799149,-0.136799387799149,-0.136799387799149,-0.131799387799149,-0.131799387799149,-0.126799387799149,-0.126799387799149,-0.121799387799149,-0.121799387799149,-0.116799387799149,-0.116799387799149,-0.111799387799149,-0.111799387799149,-0.106799387799149,-0.106799387799149,-0.101799387799149,-0.101799387799149,-0.0967993877991494,-0.0967993877991494,-0.0917993877991494,-0.0917993877991494,-0.0867993877991494,-0.0867993877991494,-0.0817993877991494,-0.0817993877991494,-0.0767993877991494,-0.0767993877991494,-0.0717993877991494,-0.0717993877991494,-0.0667993877991494,-0.0667993877991494,-0.0617993877991494,-0.0617993877991494,-0.0567993877991494,-0.0567993877991494,-0.0517993877991494,-0.0517993877991494,-0.0467993877991494,-0.0467993877991494,-0.0417993877991494,-0.0417993877991494,-0.0367993877991494,-0.0367993877991494,-0.0317993877991494,-0.0317993877991494,-0.0267993877991494,-0.0267993877991494,-0.0217993877991494,-0.0217993877991494,-0.0167993877991494,-0.0167993877991494,-0.0117993877991494,-0.0117993877991494,-0.00679938779914940,-0.00679938779914940,-0.00179938779914940,-0.00179938779914940,0.00320061220085061,0.00320061220085061,0.00820061220085061,0.00820061220085061,0.0132006122008506,0.0132006122008506,0.0182006122008506,0.0182006122008506,0.0232006122008506,0.0232006122008506,0.0282006122008506,0.0282006122008506,0.0332006122008506,0.0332006122008506,0.0382006122008506,0.0382006122008506,0.0432006122008506,0.0432006122008506,0.0482006122008506,0.0482006122008506,0.0532006122008506,0.0532006122008506,0.0582006122008506,0.0582006122008506,0.0632006122008506,0.0632006122008506,0.0682006122008506,0.0682006122008506,0.0732006122008506,0.0732006122008506,0.0782006122008506,0.0782006122008506,0.0832006122008506,0.0832006122008506,0.0882006122008506,0.0882006122008506,0.0932006122008506,0.0932006122008506,0.0982006122008506,0.0982006122008506,0.103200612200851,0.103200612200851,0.108200612200851,0.108200612200851,0.113200612200851,0.113200612200851,0.118200612200851,0.118200612200851,0.123200612200851,0.123200612200851,0.128200612200851,0.128200612200851,0.133200612200851,0.133200612200851,0.138200612200851,0.138200612200851,0.143200612200851,0.143200612200851,0.148200612200851,0.148200612200851,0.153200612200851,0.153200612200851,0.158200612200851,0.158200612200851,0.163200612200851,0.163200612200851,0.168200612200851,0.168200612200851,0.173200612200851,0.173200612200851,0.178200612200851,0.178200612200851,0.183200612200851,0.183200612200851,0.188200612200851,0.188200612200851,0.193200612200851,0.193200612200851,0.198200612200851,0.198200612200851,0.203200612200851,0.203200612200851,0.208200612200851,0.208200612200851,0.213200612200851,0.213200612200851,0.218200612200851,0.218200612200851,0.223200612200851,0.223200612200851,0.228200612200851,0.228200612200851,0.233200612200851,0.233200612200851,0.238200612200851,0.238200612200851,0.243200612200851,0.243200612200851,0.248200612200851,0.248200612200851,0.253200612200851,0.253200612200851,0.258200612200851,0.258200612200851;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;1.20000000000000,1.31000000000000,1.15000000000000,1.32000000000000,1.10000000000000,1.31000000000000,1.06000000000000,1.30000000000000,1.02000000000000,1.29000000000000,0.980000000000000,1.28000000000000,0.950000000000000,1.27000000000000,0.910000000000000,1.25000000000000,0.880000000000000,1.24000000000000,0.850000000000000,1.22000000000000,0.810000000000000,1.21000000000000,0.780000000000000,1.19000000000000,0.750000000000000,1.18000000000000,0.720000000000000,1.16000000000000,0.690000000000000,1.14000000000000,0.660000000000000,1.12000000000000,0.630000000000000,1.10000000000000,0.600000000000000,1.08000000000000,0.570000000000000,1.07000000000000,0.540000000000000,1.05000000000000,0.510000000000000,1.03000000000000,0.480000000000000,1.01000000000000,0.450000000000000,0.990000000000000,0.420000000000000,0.970000000000000,0.400000000000000,0.950000000000000,0.370000000000000,0.930000000000000,0.340000000000000,0.900000000000000,0.310000000000000,0.880000000000000,0.280000000000000,0.860000000000000,0.260000000000000,0.840000000000000,0.230000000000000,0.820000000000000,0.200000000000000,0.800000000000000,0.180000000000000,0.780000000000000,0.150000000000000,0.750000000000000,0.120000000000000,0.730000000000000,0.100000000000000,0.710000000000000,0.0699999999999998,0.690000000000000,0.0400000000000000,0.670000000000000,0.0200000000000000,0.640000000000000,-0.00999999999999979,0.620000000000000,-0.0299999999999998,0.600000000000000,-0.0600000000000001,0.570000000000000,-0.0899999999999999,0.550000000000000,-0.110000000000000,0.530000000000000,-0.140000000000000,0.500000000000000,-0.160000000000000,0.480000000000000,-0.190000000000000,0.460000000000000,-0.210000000000000,0.430000000000000,-0.240000000000000,0.410000000000000,-0.260000000000000,0.390000000000000,-0.280000000000000,0.360000000000000,-0.310000000000000,0.340000000000000,-0.330000000000000,0.310000000000000,-0.360000000000000,0.290000000000000,-0.380000000000000,0.260000000000000,-0.410000000000000,0.240000000000000,-0.430000000000000,0.210000000000000,-0.450000000000000,0.190000000000000,-0.480000000000000,0.160000000000000,-0.500000000000000,0.140000000000000,-0.520000000000000,0.110000000000000,-0.550000000000000,0.0899999999999999,-0.570000000000000,0.0600000000000001,-0.590000000000000,0.0400000000000000,-0.620000000000000,0.0100000000000002,-0.640000000000000,-0.0200000000000000,-0.660000000000000,-0.0400000000000000,-0.680000000000000,-0.0699999999999998,-0.710000000000000,-0.0899999999999999,-0.730000000000000,-0.120000000000000,-0.750000000000000,-0.150000000000000,-0.770000000000000,-0.170000000000000,-0.790000000000000,-0.200000000000000,-0.820000000000000,-0.230000000000000,-0.840000000000000,-0.250000000000000,-0.860000000000000,-0.280000000000000,-0.880000000000000,-0.310000000000000,-0.900000000000000,-0.340000000000000,-0.920000000000000,-0.370000000000000,-0.940000000000000,-0.390000000000000,-0.960000000000000,-0.420000000000000,-0.980000000000000,-0.450000000000000,-1,-0.480000000000000,-1.02000000000000,-0.510000000000000,-1.04000000000000,-0.540000000000000,-1.06000000000000,-0.570000000000000,-1.08000000000000,-0.600000000000000,-1.10000000000000,-0.630000000000000,-1.12000000000000,-0.660000000000000,-1.13000000000000,-0.690000000000000,-1.15000000000000,-0.720000000000000,-1.17000000000000,-0.750000000000000,-1.19000000000000,-0.780000000000000,-1.20000000000000,-0.810000000000000,-1.22000000000000,-0.850000000000000,-1.23000000000000,-0.880000000000000,-1.25000000000000,-0.910000000000000,-1.26000000000000,-0.950000000000000,-1.27000000000000,-0.990000000000000,-1.29000000000000,-1.02000000000000,-1.30000000000000,-1.06000000000000,-1.30000000000000,-1.10000000000000,-1.31000000000000,-1.15000000000000,-1.30000000000000,-1.21000000000000;];
Exb1=[-0.175000000000000,-0.175000000000000,-0.170000000000000,-0.170000000000000,-0.165000000000000,-0.165000000000000,-0.160000000000000,-0.160000000000000,-0.155000000000000,-0.155000000000000,-0.150000000000000,-0.150000000000000,-0.145000000000000,-0.145000000000000,-0.140000000000000,-0.140000000000000,-0.135000000000000,-0.135000000000000,-0.130000000000000,-0.130000000000000,-0.125000000000000,-0.125000000000000,-0.120000000000000,-0.120000000000000,-0.115000000000000,-0.115000000000000,-0.110000000000000,-0.110000000000000,-0.105000000000000,-0.105000000000000,-0.100000000000000,-0.100000000000000,-0.0950000000000000,-0.0950000000000000,-0.0900000000000000,-0.0900000000000000,-0.0850000000000000,-0.0850000000000000,-0.0800000000000000,-0.0800000000000000,-0.0750000000000000,-0.0750000000000000,-0.0700000000000000,-0.0700000000000000,-0.0650000000000000,-0.0650000000000000,-0.0600000000000000,-0.0600000000000000,-0.0550000000000000,-0.0550000000000000,-0.0500000000000000,-0.0500000000000000,-0.0450000000000000,-0.0450000000000000,-0.0400000000000000,-0.0400000000000000,-0.0350000000000000,-0.0350000000000000,-0.0300000000000000,-0.0300000000000000,-0.0250000000000000,-0.0250000000000000,-0.0200000000000000,-0.0200000000000000,-0.0150000000000000,-0.0150000000000000,-0.0100000000000000,-0.0100000000000000,-0.00500000000000000,-0.00500000000000000,0,0,0.00500000000000000,0.00500000000000000,0.00999999999999998,0.00999999999999998,0.0150000000000000,0.0150000000000000,0.0200000000000000,0.0200000000000000,0.0250000000000000,0.0250000000000000,0.0300000000000000,0.0300000000000000,0.0350000000000000,0.0350000000000000,0.0400000000000000,0.0400000000000000,0.0450000000000000,0.0450000000000000,0.0500000000000000,0.0500000000000000,0.0550000000000000,0.0550000000000000,0.0600000000000000,0.0600000000000000,0.0650000000000000,0.0650000000000000,0.0700000000000000,0.0700000000000000,0.0750000000000000,0.0750000000000000,0.0800000000000000,0.0800000000000000,0.0850000000000000,0.0850000000000000,0.0900000000000000,0.0900000000000000,0.0950000000000000,0.0950000000000000,0.100000000000000,0.100000000000000,0.105000000000000,0.105000000000000,0.110000000000000,0.110000000000000,0.115000000000000,0.115000000000000,0.120000000000000,0.120000000000000,0.125000000000000,0.125000000000000,0.130000000000000,0.130000000000000,0.135000000000000,0.135000000000000,0.140000000000000,0.140000000000000,0.145000000000000,0.145000000000000,0.150000000000000,0.150000000000000,0.155000000000000,0.155000000000000,0.160000000000000,0.160000000000000,0.165000000000000,0.165000000000000,0.170000000000000,0.170000000000000,0.175000000000000,0.175000000000000;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;0.0600000000000001,0.120000000000000,0.0400000000000000,0.130000000000000,0.0300000000000000,0.140000000000000,0.0100000000000000,0.150000000000000,0,0.160000000000000,-0.0100000000000000,0.160000000000000,-0.0200000000000000,0.170000000000000,-0.0300000000000000,0.170000000000000,-0.0300000000000000,0.180000000000000,-0.0400000000000000,0.180000000000000,-0.0499999999999999,0.180000000000000,-0.0599999999999999,0.180000000000000,-0.0599999999999999,0.180000000000000,-0.0700000000000000,0.190000000000000,-0.0700000000000000,0.190000000000000,-0.0800000000000000,0.190000000000000,-0.0900000000000000,0.190000000000000,-0.0900000000000000,0.190000000000000,-0.100000000000000,0.190000000000000,-0.100000000000000,0.190000000000000,-0.110000000000000,0.190000000000000,-0.110000000000000,0.190000000000000,-0.110000000000000,0.190000000000000,-0.120000000000000,0.190000000000000,-0.120000000000000,0.190000000000000,-0.130000000000000,0.190000000000000,-0.130000000000000,0.180000000000000,-0.130000000000000,0.180000000000000,-0.140000000000000,0.180000000000000,-0.140000000000000,0.180000000000000,-0.140000000000000,0.180000000000000,-0.150000000000000,0.180000000000000,-0.150000000000000,0.170000000000000,-0.150000000000000,0.170000000000000,-0.150000000000000,0.170000000000000,-0.160000000000000,0.170000000000000,-0.160000000000000,0.160000000000000,-0.160000000000000,0.160000000000000,-0.160000000000000,0.160000000000000,-0.170000000000000,0.160000000000000,-0.170000000000000,0.150000000000000,-0.170000000000000,0.150000000000000,-0.170000000000000,0.150000000000000,-0.170000000000000,0.140000000000000,-0.170000000000000,0.140000000000000,-0.180000000000000,0.140000000000000,-0.180000000000000,0.130000000000000,-0.180000000000000,0.130000000000000,-0.180000000000000,0.120000000000000,-0.180000000000000,0.120000000000000,-0.180000000000000,0.120000000000000,-0.180000000000000,0.110000000000000,-0.180000000000000,0.110000000000000,-0.180000000000000,0.100000000000000,-0.180000000000000,0.100000000000000,-0.180000000000000,0.0900000000000001,-0.180000000000000,0.0800000000000001,-0.180000000000000,0.0800000000000001,-0.170000000000000,0.0700000000000001,-0.170000000000000,0.0700000000000001,-0.170000000000000,0.0600000000000001,-0.170000000000000,0.0500000000000000,-0.170000000000000,0.0400000000000000,-0.160000000000000,0.0400000000000000,-0.160000000000000,0.0300000000000000,-0.150000000000000,0.0200000000000000,-0.150000000000000,0.0100000000000000,-0.140000000000000,0,-0.130000000000000,-0.0200000000000000,-0.120000000000000,-0.0300000000000000,-0.110000000000000,-0.0499999999999999;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;];
Exb2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;-0.251799387799149,-0.251799387799149,-0.246799387799149,-0.246799387799149,-0.241799387799149,-0.241799387799149,-0.236799387799149,-0.236799387799149,-0.231799387799149,-0.231799387799149,-0.226799387799149,-0.226799387799149,-0.221799387799149,-0.221799387799149,-0.216799387799149,-0.216799387799149,-0.211799387799149,-0.211799387799149,-0.206799387799149,-0.206799387799149,-0.201799387799149,-0.201799387799149,-0.196799387799149,-0.196799387799149,-0.191799387799149,-0.191799387799149,-0.186799387799149,-0.186799387799149,-0.181799387799149,-0.181799387799149,-0.176799387799149,-0.176799387799149,-0.171799387799149,-0.171799387799149,-0.166799387799149,-0.166799387799149,-0.161799387799149,-0.161799387799149,-0.156799387799149,-0.156799387799149,-0.151799387799149,-0.151799387799149,-0.146799387799149,-0.146799387799149,-0.141799387799149,-0.141799387799149,-0.136799387799149,-0.136799387799149,-0.131799387799149,-0.131799387799149,-0.126799387799149,-0.126799387799149,-0.121799387799149,-0.121799387799149,-0.116799387799149,-0.116799387799149,-0.111799387799149,-0.111799387799149,-0.106799387799149,-0.106799387799149,-0.101799387799149,-0.101799387799149,-0.0967993877991494,-0.0967993877991494,-0.0917993877991494,-0.0917993877991494,-0.0867993877991494,-0.0867993877991494,-0.0817993877991494,-0.0817993877991494,-0.0767993877991494,-0.0767993877991494,-0.0717993877991494,-0.0717993877991494,-0.0667993877991494,-0.0667993877991494,-0.0617993877991494,-0.0617993877991494,-0.0567993877991494,-0.0567993877991494,-0.0517993877991494,-0.0517993877991494,-0.0467993877991494,-0.0467993877991494,-0.0417993877991494,-0.0417993877991494,-0.0367993877991494,-0.0367993877991494,-0.0317993877991494,-0.0317993877991494,-0.0267993877991494,-0.0267993877991494,-0.0217993877991494,-0.0217993877991494,-0.0167993877991494,-0.0167993877991494,-0.0117993877991494,-0.0117993877991494,-0.00679938779914940,-0.00679938779914940,-0.00179938779914940,-0.00179938779914940,0.00320061220085061,0.00320061220085061,0.00820061220085061,0.00820061220085061,0.0132006122008506,0.0132006122008506,0.0182006122008506,0.0182006122008506,0.0232006122008506,0.0232006122008506,0.0282006122008506,0.0282006122008506,0.0332006122008506,0.0332006122008506,0.0382006122008506,0.0382006122008506,0.0432006122008506,0.0432006122008506,0.0482006122008506,0.0482006122008506,0.0532006122008506,0.0532006122008506,0.0582006122008506,0.0582006122008506,0.0632006122008506,0.0632006122008506,0.0682006122008506,0.0682006122008506,0.0732006122008506,0.0732006122008506,0.0782006122008506,0.0782006122008506,0.0832006122008506,0.0832006122008506,0.0882006122008506,0.0882006122008506,0.0932006122008506,0.0932006122008506,0.0982006122008506,0.0982006122008506,0.103200612200851,0.103200612200851,0.108200612200851,0.108200612200851,0.113200612200851,0.113200612200851,0.118200612200851,0.118200612200851,0.123200612200851,0.123200612200851,0.128200612200851,0.128200612200851,0.133200612200851,0.133200612200851,0.138200612200851,0.138200612200851,0.143200612200851,0.143200612200851,0.148200612200851,0.148200612200851,0.153200612200851,0.153200612200851,0.158200612200851,0.158200612200851,0.163200612200851,0.163200612200851,0.168200612200851,0.168200612200851,0.173200612200851,0.173200612200851,0.178200612200851,0.178200612200851,0.183200612200851,0.183200612200851,0.188200612200851,0.188200612200851,0.193200612200851,0.193200612200851,0.198200612200851,0.198200612200851,0.203200612200851,0.203200612200851,0.208200612200851,0.208200612200851,0.213200612200851,0.213200612200851,0.218200612200851,0.218200612200851,0.223200612200851,0.223200612200851,0.228200612200851,0.228200612200851,0.233200612200851,0.233200612200851,0.238200612200851,0.238200612200851,0.243200612200851,0.243200612200851,0.248200612200851,0.248200612200851,0.253200612200851,0.253200612200851;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;1.12000000000000,1.17000000000000,1.07000000000000,1.17000000000000,1.04000000000000,1.16000000000000,1,1.15000000000000,0.970000000000000,1.14000000000000,0.940000000000000,1.13000000000000,0.910000000000000,1.11000000000000,0.880000000000000,1.10000000000000,0.850000000000000,1.08000000000000,0.820000000000000,1.06000000000000,0.790000000000000,1.05000000000000,0.760000000000000,1.03000000000000,0.740000000000000,1.01000000000000,0.710000000000000,0.990000000000000,0.680000000000000,0.970000000000000,0.660000000000000,0.960000000000000,0.630000000000000,0.940000000000000,0.600000000000000,0.920000000000000,0.580000000000000,0.900000000000000,0.550000000000000,0.880000000000000,0.520000000000000,0.860000000000000,0.500000000000000,0.840000000000000,0.470000000000000,0.820000000000000,0.450000000000000,0.800000000000000,0.420000000000000,0.780000000000000,0.400000000000000,0.760000000000000,0.370000000000000,0.740000000000000,0.350000000000000,0.720000000000000,0.320000000000000,0.700000000000000,0.300000000000000,0.680000000000000,0.270000000000000,0.660000000000000,0.250000000000000,0.640000000000000,0.230000000000000,0.620000000000000,0.200000000000000,0.600000000000000,0.180000000000000,0.570000000000000,0.150000000000000,0.550000000000000,0.130000000000000,0.530000000000000,0.110000000000000,0.510000000000000,0.0800000000000001,0.490000000000000,0.0600000000000001,0.470000000000000,0.0300000000000003,0.440000000000000,0.0100000000000002,0.420000000000000,-0.00999999999999979,0.400000000000000,-0.0400000000000000,0.380000000000000,-0.0600000000000001,0.360000000000000,-0.0800000000000001,0.330000000000000,-0.100000000000000,0.310000000000000,-0.130000000000000,0.290000000000000,-0.150000000000000,0.270000000000000,-0.170000000000000,0.250000000000000,-0.200000000000000,0.220000000000000,-0.220000000000000,0.200000000000000,-0.240000000000000,0.180000000000000,-0.260000000000000,0.150000000000000,-0.290000000000000,0.130000000000000,-0.310000000000000,0.110000000000000,-0.330000000000000,0.0899999999999999,-0.350000000000000,0.0600000000000001,-0.380000000000000,0.0400000000000000,-0.400000000000000,0.0200000000000000,-0.420000000000000,-0.00999999999999979,-0.440000000000000,-0.0299999999999998,-0.460000000000000,-0.0499999999999998,-0.480000000000000,-0.0800000000000001,-0.510000000000000,-0.100000000000000,-0.530000000000000,-0.130000000000000,-0.550000000000000,-0.150000000000000,-0.570000000000000,-0.170000000000000,-0.590000000000000,-0.200000000000000,-0.610000000000000,-0.220000000000000,-0.630000000000000,-0.250000000000000,-0.650000000000000,-0.270000000000000,-0.670000000000000,-0.300000000000000,-0.700000000000000,-0.320000000000000,-0.720000000000000,-0.340000000000000,-0.740000000000000,-0.370000000000000,-0.760000000000000,-0.390000000000000,-0.780000000000000,-0.420000000000000,-0.800000000000000,-0.450000000000000,-0.820000000000000,-0.470000000000000,-0.840000000000000,-0.500000000000000,-0.860000000000000,-0.520000000000000,-0.880000000000000,-0.550000000000000,-0.890000000000000,-0.570000000000000,-0.910000000000000,-0.600000000000000,-0.930000000000000,-0.630000000000000,-0.950000000000000,-0.650000000000000,-0.970000000000000,-0.680000000000000,-0.990000000000000,-0.710000000000000,-1.01000000000000,-0.730000000000000,-1.02000000000000,-0.760000000000000,-1.04000000000000,-0.790000000000000,-1.06000000000000,-0.820000000000000,-1.07000000000000,-0.850000000000000,-1.09000000000000,-0.880000000000000,-1.11000000000000,-0.910000000000000,-1.12000000000000,-0.940000000000000,-1.13000000000000,-0.970000000000000,-1.15000000000000,-1,-1.16000000000000,-1.04000000000000,-1.16000000000000,-1.07000000000000,-1.16000000000000,-1.12000000000000;];

Sxbound1=Sxb1;
Sxbound2=Sxb2;
Bxbound1=Bxb1;
Bxbound2=Bxb2;
Exbound1=Exb1;
Exbound2=Exb2;

plotPendulum('Safety Controller System Trajectory', time_traj, St, SPt, SPdt, SDPt, SDPdt, SuSatt, Sut, Sxbound1, Sxbound2);
plotPendulum('Baseline Controller System Trajectory', time_traj, Bt, BPt, BPdt, SDPt, SDPdt, BuSatt, But, Bxbound1, Bxbound2);
plotPendulum('Experimental Controller System Trajectory', time_traj, Et, EPt, EPdt, SDPt, SDPdt, EuSatt, Eut, Exbound1, Exbound2);
plotPendulum('Switching Proper (S->B->E) Controller System Trajectory', time_traj, Swt, SwRPt, SwRPdt, SDPt, SDPdt, SwRuSatt, SwRut, Sxbound1, Sxbound2);


figure;
hold on;
plot(Sxbound1(1:1,:),Sxbound1(3:3,:),'bo');
plot(Bxbound1(1:1,:),Bxbound1(3:3,:),'g*');
plot(Exbound1(1:1,:),Exbound1(3:3,:),'k+');
title('Stabilizable Regions for x and xDot');
legend('Safety', 'Baseline', 'Experimental');
xlabel('x (m)');
ylabel('xDot (m/s)');

figure;
hold on;
plot(Sxbound2(2:2,:),Sxbound2(4:4,:),'bo');
plot(Bxbound2(2:2,:),Bxbound2(4:4,:),'g*');
plot(Exbound2(2:2,:),Exbound2(4:4,:),'k+');
title('Stabilizable Regions for \theta and \theta Dot');
legend('Safety', 'Baseline', 'Experimental');
xlabel('\theta (rad)');
ylabel('\theta Dot (rad/s)');
